#ifndef QUEUE_H
#define QUEUE_H
#include "list.h"
#include <pthread.h>

typedef struct {
	struct list_head list;
	int count;
	pthread_cond_t cond;
	pthread_mutex_t lock;
}queue_t;

typedef struct {
	struct list_head list;
	void *node;
}queue_item_t;


extern queue_t* queque_create(void);
extern void queue_push(queue_t *queue, queue_item_t *item);
extern struct list_head * queue_pop(queue_t *queue, struct list_head *new_head);
extern void queue_destroy(queue_t *queue);
extern queue_item_t * queue_item_init(void *data);
extern void queue_item_free(queue_item_t *it);
extern queue_item_t *queue_item_get(queue_t *queue, int i);

#endif
